<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Promise关键问题 - Promise 改变状态与指定回调的顺序问题</title>
</head>
<body>
    <!-- <script src="atguigu-promise.js"></script> -->
    <script>

        setTimeout(() => {
           console.log('开始执行setTimeout 10 ') ;
        }, 10);

        setTimeout(() => {
           console.log('开始执行setTimeout 0') ;
        });

        let p = new Promise((resolve, reject) => {
            resolve('OK');
        });

        console.log('hahahh') ;
        
        p.then(value => {
            console.log('then里面的回调是异步的', value);
        },reason=>{
            console.log('reason => ', reason) ;
        })

        console.log('the end ....')
    </script>
</body>
</html>